package org.icosagon.core.magic;

import org.icosagon.core.items.Item;

/**
 * The magical component to cast a spell. The type describes what
 * this component is and how it activates the spell.
 * @author Daniel Owens
 */
public class Component {

    public static final String VERBAL = "VERBAL";
    public static final String SOMATIC = "SOMATIC";
    public static final String MATERIAL = "MATERIAL";
    public static final String  FOCUS = "FOCUS";
    public static final String DIVINE_FOCUS = "DIVINE FOCUS";
    public static final String EXPERIENCE = "EXPERIENCE";

    private Item item = null;
    private boolean metamagic = false;
    private String type = "VERBAL";

    public Component(){}
    public Component(String type) {
        this.type = type;
    }

    public void setItem(Item material) {
        this.item = material;
    }

    public Item getItem() {
        return this.item;
    }

    public void setMetamagic(boolean value) {
        this.metamagic = value;
    }

    public boolean isMetamagicComponent() {
        return this.metamagic;
    }

    /**
     * Sets the type of component this is. The String value allows for
     * User created component types.
     * @param value
     */
    public void setType(String value) {
        if(value != null && value.equals(value))
            this.type = value;
    }

    public String getType() {
        return this.type;
    }
}